<div id="tab-commands">
        <input class="navbutton" type="button" id="upload_button" value="Upload new Component"/>
        <input class="navbutton" type="button" id="components_usage_button" value="List Components Usage" onclick="window.location='/component/list-components-usage';"/>
        <input class="navbutton" type="button" id="list_components_button" value="List Components" onclick="window.location='/component/list-components';"/>
        <input class="navbutton" type="button" id="install_all_components_button" value="Install All from Components Dir" onclick="window.location='/component/install-all-components-in-components-dir';" />

</div>

<script type="text/javascript">
function ajaxUpload() {
	new AjaxUpload('#upload_button', {
		  // Location of the server-side upload script
		  action: '/component/upload',
		  // File upload name
		  name: 'componentfile',
		  // Additional data to send
		  data: {},
		  // Submit file after selection
		  autoSubmit: true,
		  // The type of data that you're expecting back from the server.
		  // Html (text) and xml are detected automatically.
		  // Only useful when you are using json data as a response.
		  // Set to "json" in that case.
		  responseType: false,
		  // Fired after the file is selected
		  // Useful when autoSubmit is disabled
		  // You can return false to cancel upload
		  // @param file basename of uploaded file
		  // @param extension of that file
		  onChange: function(file, extension){},
		  // Fired before the file is uploaded
		  // You can return false to cancel upload
		  // @param file basename of uploaded file
		  // @param extension of that file
		  onSubmit: function(file, extension) {},
		  // Fired when file upload is completed
		  // WARNING! DO NOT USE "FALSE" STRING AS A RESPONSE!
		  // @param file basename of uploaded file
		  // @param response server response
		  onComplete: function(file, response) {
			 		$('#messages').load('/index/get-messages');
			  }
		});
}


$(document).ready(function() {
    	ajaxUpload();
});


</script>